import request from '@/utils/request'

// 获取权限路由方法
export function getRouters(data) {
  return request({
    url: `/getRouters`,
    method: 'get'
  })
}
//获取所有路由
export function routerList(data) {
  return request({
    url: `/menu/allList`,
    method: 'post',
    data
  })
}

export function addRoute(data) {
  return request({
    url: `/menu`,
    method: 'post',
    data
  })
}

export function putRoute(data) {
  return request({
    url: `/menu`,
    method: 'put',
    data
  })
}

export function delRoute(data) {
  return request({
    url: `/menu/${data.id}`,
    method: 'delete',
    data
  })
}

export function getRoute(data) {
  return request({
    url: `/menu/${data.id}`,
    method: 'get'
  })
}

export function roleToMenu(data) {
  return request({
    url: `/menu/menuRoleTree/${data.id}`,
    method: 'get'
  })
}
